/*
 * @Author: zi.yang
 * @Date: 2021-10-02 13:50:32
 * @LastEditors: zi.yang
 * @LastEditTime: 2021-10-10 17:43:54
 * @Description: In User Settings Edit
 * @FilePath: \one.pm\src\apis\api\user.js
 */
import http from '@/Utils/request'

export default {
  fetchLogin: data => http.post('/users/login', data),
  fetchRefreshToken: (userinfo, loginTime) => http.post('/users/refreshToken', { userinfo, loginTime }),
  fetchFindAllUser: () => http.get('/users/findAll'),
  fetchUserInfoById: userId => http.get('/users/findInfoById', { id: userId }),
  fetchUserAdd: data => http.post('/users/addUser', data),
  fetchUserDelete: userId => http.delete('/users/deleteUserById', { id: userId }),
  fetchUserUpdate: (id, userinfo) => http.put('/users/updateUserById', { id, userinfo }),
  fetchPasswordUpdate: (id, password) => http.put('/users/changePasswordById', { id, password }),
  fetchAvatarUpload: (data) => http.post('/users/uploadAvatar', data)
}
